Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release database emulator v4.2.0 #1564

Merged
merged 3 commits into from
Jul 30, 2019
Merged

Conversation

jmwski
Copy link
Contributor

@jmwski jmwski commented Jul 30, 2019

Database emulator release for function triggers upsert endpoint.

@googlebot googlebot added the cla: yes Manual indication that this has passed CLA. label Jul 30, 2019
@samtstern
Copy link
Contributor

$ npx firebase emulators:start
i  Starting emulators: ["functions","database"]
⚠  Your requested "node" version "8" doesn't match your global version "10"
✔  functions: Emulator started at http://localhost:5001
i  database: downloading firebase-database-emulator-v4.2.0.jar...
Progress: ===================================================================> (100% of 18MB)
i  Shutting down emulators.
i  Stopping functions emulator

Error: download failed, expected 17131418 bytes but got 17124145

@coveralls
Copy link

coveralls commented Jul 30, 2019

Coverage Status

Coverage remained the same at 63.942% when pulling c50cd0c on wyszynski/database-emulator-v4.2.0 into ffcdd55 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 63.942% when pulling 7591825 on wyszynski/database-emulator-v4.2.0 into 509a49b on master.

@jmwski
Copy link
Contributor Author

jmwski commented Jul 30, 2019

$ npx firebase emulators:start
i  Starting emulators: ["functions","database"]
⚠  Your requested "node" version "8" doesn't match your global version "10"
✔  functions: Emulator started at http://localhost:5001
i  database: downloading firebase-database-emulator-v4.2.0.jar...
Progress: ===================================================================> (100% of 18MB)
i  Shutting down emulators.
i  Stopping functions emulator

Error: download failed, expected 17131418 bytes but got 17124145

Forgot to update the storage url.

@jmwski
Copy link
Contributor Author

jmwski commented Jul 30, 2019

$ npx firebase emulators:start
i  Starting emulators: ["functions","database"]
⚠  Your requested "node" version "8" doesn't match your global version "10"
✔  functions: Emulator started at http://localhost:5001
i  database: downloading firebase-database-emulator-v4.2.0.jar...
Progress: ===================================================================> (100% of 18MB)
i  Shutting down emulators.
i  Stopping functions emulator

Error: download failed, expected 17131418 bytes but got 17124145

Forgot to update the storage url.

i  Starting emulators: ["database"]
i  database: downloading firebase-database-emulator-v4.2.0.jar...
Progress: =====================================================================================================================================> (100% of 18MB)
i  database: Removing outdated emulator: firebase-database-emulator-v4.1.1.jar
i  database: Emulator logging to database-debug.log
✔  database: Emulator started at http://localhost:9000
i  database: For testing set FIREBASE_DATABASE_EMULATOR_HOST=localhost:9000
✔  All emulators started, it is now safe to connect.

@samtstern
Copy link
Contributor

Modified the functions emulator to use the new endpoint, then tested with these functions:

const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();

exports.helloWorld = functions.https.onRequest(async (request, response) => {
 
    await admin.database().ref('test/test1').set({ hello: 'world '});
    await admin.database().ref('test/test2').set({ hello: 'other' });

    response.send("Hello from Firebase!");
});

exports.databaseOne = functions.database.ref('test/test1').onWrite((change, ctx) => {
    console.log('DB1');
    return true;
});

exports.databaseTwo = functions.database.ref('test/test2').onWrite((change, ctx) => {
    console.log('DB2');
    return true;
});

Got this result:

$ npx firebase emulators:start
i  Starting emulators: ["functions","database"]
⚠  Your requested "node" version "8" doesn't match your global version "10"
✔  functions: Emulator started at http://localhost:5001
i  database: Emulator logging to database-debug.log
✔  database: Emulator started at http://localhost:9000
i  database: For testing set FIREBASE_DATABASE_EMULATOR_HOST=localhost:9000
i  functions: Watching "/tmp/tmp.ddVISM2wPN/functions" for Cloud Functions...
✔  functions[helloWorld]: http function initialized (http://localhost:5001/fir-dumpster/us-central1/helloWorld).
✔  functions[databaseOne]: database function initialized.
✔  functions[databaseTwo]: database function initialized.
✔  All emulators started, it is now safe to connect.
i  functions: Beginning execution of "helloWorld"
i  functions: Finished "helloWorld" in ~1s
i  functions: Beginning execution of "databaseTwo"
i  functions: Beginning execution of "databaseOne"
>  DB1
i  functions: Finished "databaseOne" in ~1s
>  DB2
i  functions: Finished "databaseTwo" in ~1s

@bkendall
Copy link
Contributor

You'll want to sync your branch w/ master locally on your machine. changelog.txt has been renamed to CHANGELOG.md, so your entry will just have to be moved.

@samtstern samtstern mentioned this pull request Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants